<% if current_user %>
  <button id="dropdown-trigger-links-mobile" class="main-bar__links-mobile__item" data-controller="dropdown" data-target="dropdown-menu-account-mobile">
    <% if current_user.notifications.any? %>
      <span class="main-bar__notification"></span>
    <% end %>
    <% if current_user.avatar.attached? %>
      <span class="main-bar__avatar">
        <%= image_tag(
                current_user.attached_uploader(:avatar).variant_url(:thumb),
                alt: t("decidim.author.avatar", name: decidim_sanitize(current_user.avatar.name))
              ) %>
      </span>
    <% else %>
      <div class="main-bar__avatar-name">
        <%= text_initials(current_user.name) %>
      </div>
    <% end %>

  </button>
<% else %>
  <%= link_to decidim.new_user_session_path, class: "main-bar__links-mobile__login" do %>
    <%= icon "user-line" %><span><%= t("layouts.decidim.header.log_in") %></span>
  <% end %>
<% end %>
